package com.zhigh.project.security.jwt.authentication.event;

import com.zhigh.project.security.jwt.authentication.NullAuthentication;
import org.springframework.lang.Nullable;
import org.springframework.security.authentication.event.AbstractAuthenticationFailureEvent;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;

import java.util.Optional;

public class JWTAuthenticationFailureEvent extends AbstractAuthenticationFailureEvent {


    public JWTAuthenticationFailureEvent(@Nullable Authentication authentication, AuthenticationException exception) {
        super(Optional.ofNullable(authentication).orElse(NullAuthentication.NONE), exception);
    }


}
